home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Extra 1997 #1 / Amiga Plus Extra 1997 #1.iso / programme / daten / adm / arexx / adm-arexxmakros.lha / Netze / April / search_adm.rexx < prev   
OS/2 REXX Batch file  |  1995-06-04  |  2KB  |  85 lines

  1. /* $VER 0.1 Search_ADM.rexx (5.6.93)
  2.  
  3.    Macro for April-Point-Package.
  4.  
  5.    Made for external menu (fill in there for the command)
  6.  
  7.    %req "%cmd \"sys:rexxc/rx rexx:Search_ADM %string/\\"Type in the lastname\\" >NIL:\" "%#ram:tmp"
  8.  
  9.    The scripts asks for a name or a pattern of a name, type in there
  10.    "De Jon*" and it comes back with a requester which types out all
  11.    Fido-adresses of the De Jong brothers.
  12.  
  13.    One restriction, the first four letters of the EMail-address in the
  14.    ADM-database have to be: Fido. Thats because April is a Fido-package, so
  15.    you only get the Fido-addresses of your database.
  16.  
  17.    You can use patterns like in normal Amiga-DOS like "#?" of "*" if you have
  18.    a patch tool for that.
  19.  
  20.    Written by Carsten Fulde  Fido: 2:245/6804.21                      */
  21.  
  22.  
  23. OPTIONS RESULTS
  24.  
  25. parse arg WORT
  26.  
  27. if ~show(l, "rexxsupport.library") then
  28.     if ~addlib("rexxsupport.library", 0, -30, 0) then do
  29.         say "Couldn't open rexxsupport.library !"       /* open support.lib */
  30.         exit 20
  31.         end
  32.  
  33. if ~open('output','ram:tmp','w') then do
  34.     say 'Couldn''t open ram:tmp ! '
  35.     exit 20
  36.     end
  37.  
  38. fst   = 1                      /* Anfangsposition = 1 (= erste Adresse) */
  39. found = 0
  40.  
  41. ADM.LASTNAME = WORT
  42.  
  43. dummy = writeln('output'," ")
  44.  
  45. DO FOREVER                   /* Endlosschleife */
  46.  
  47.    ADDRESS 'ADM.1'
  48.  
  49.    SEARCH fst ADM            /* Eintrag suchen */
  50.  
  51.    found = RESULT
  52.  
  53.    IF found >-1 THEN DO        /* Rückgabewert = Nummer der gefundenen
  54.                                 Adresse */
  55.       GETADDRESS RESAD       /* Adresse holen in Stemvariable RESAD   */
  56.  
  57.  
  58.       e1 = upper(RESAD.EMAIL1)
  59.  
  60.       e2 = upper(RESAD.EMAIL2)
  61.  
  62.       IF (pos('FIDO',e1)) | (pos('FIDO',e2))'' THEN DO
  63.  
  64.          IF (pos('FIDO',e1)) THEN
  65.  
  66.             dummy = writeln('output', right(RESAD.EMAIL1,length(e1)-5))
  67.  
  68.          IF (pos('FIDO',e2)) THEN
  69.  
  70.             dummy = writeln('output', right(RESAD.EMAIL2,length(e2)-5))
  71.  
  72.          END /* DO */
  73.  
  74.       fst = found + 1
  75.  
  76.       END /* DO */
  77.  
  78.    ELSE
  79.  
  80.       EXIT 0
  81.  
  82.    END /* IF */
  83.  
  84. END /* DO */
  85.